<?php

namespace App\Http\Middleware;

use Closure;

class ForceJson
{
    /**
     * 让所有信息都返回json格式的中间件
	 *
	 * desc 放在需要的路由上
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
		$request->headers->set('accept', 'application/json');

        return $next($request);
    }
}
